let vm = new Vue({
    el: '#app',  //选中整个main
    data() {
        return {
            title:'',
            page:{},
        }
    },
    methods: {
        selectPage: function (start=1,pageSize=3) {
            //获取当前用户的id
            let id = JSON.parse(sessionStorage.getItem("user")).id;
            axios({
                url: `article/selectFavoritePage/${start}/${pageSize}`,
                params: {
                    uId:id,
                    title:this.title
                }
            }).then(response => {
                //不成功提示
                if (response.data.success) {
                    this.page=response.data.obj;
                } else {
                    //登陆失败
                    layer.msg(response.data.msg);
                }
            }).catch(error => {
                layer.msg(error.message);
            })
        },
        todetil:function (art) {
            layer.obj = art;
            layer.open({
                type: 2,
                title: '详情',
                maxmin: true,
                shadeClose: true, //点击遮罩关闭层
                area : ['1000px' , '80%'],
                content: 'html/article_detail.html',
                end:()=>{
                    this.selectPage();
                }
            });
        },
    },
    created:function () {
        this.selectPage();
        console.log(this.page)
    }
});